package src.lab02.text05;

/**
 * Created by 12442 on 2017/10/15.
 */
public class Cube {
    //属性：长、宽和高
    float length;
    float wide;
    float high;
    //行为：对这三个变量进行初始化，求立方体的体积
    public Cube(float l,float w,float h){
        this.length=l;
        this.wide=w;
        this.high=h;
    }
    //构造函数：求给定尺寸的立方体的体积
    public float buiktext(){
        return this.length*this.wide*this.high;
    }
    //main函数
    public static void main(String[] args) {
        Cube cube1 = new Cube(1, 2, 3);
        System.out.println("体积是："+cube1.buiktext());
    }
}
